/*
 * Copyright (c) 2011 Team A CS2340. All rights reserved.
 */
package edu.gatech.teama.doctorsoffice.net;

import edu.gatech.teama.doctorsoffice.server.DataModel;

import edu.gatech.teama.doctorsoffice.model.User;
/**
 * Describe updated user message by extending message class
 * 
 * @author Dylan
 * @version 1.0
 */
public class UpdateUserMessage extends Message {
	/**
	 * initialize instance payload
	 * @param objPayload the object user
	 */
	public UpdateUserMessage(User objPayload) {
		super(objPayload);
		// TODO Auto-generated constructor stub
	}

	/**
	 * send message if user updated
	 * @param model data to manipulate in this case User
	 * @return successful
	 */
	public Message handle(final DataModel model) {
		// TODO Auto-generated method stub
		model.updateUser((User) this.getPayload());
		return new SuccessMessage(true);
	}

}
